<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我要点评 - 爽客网</title>
<%@include file="../common/js.jsp" %>
<%@include file="../common/jspcommon.jsp" %>
<%@include file="../common/css.jsp" %>

<link href="css/other.css" type="text/css" rel="stylesheet" />

<!--[if ie 6]><script src="../js/common/iepng.js" type="text/javascript"></script><![endif]-->
<!--[if ie 6]><link href="../../css/jrIE6.css" type="text/css" rel="stylesheet"><![endif]-->
<!--[if ie]><link href="../../css/jrIE.css" type="text/css" rel="stylesheet"><![endif]-->
<script type="text/javascript">
function rate(obj,oEvent){

		var imgSrc = 'images/smallpic/icon_16.gif'; //没有填色的星星
		var imgSrc_2 = 'images/smallpic/icon_15.gif'; //打分后有颜色的星星
		//---------------------------------------------------------------------------
		var e = oEvent || window.event;
		var target = e.target || e.srcElement; 
		var imgArray = obj.getElementsByTagName("img");
		for(var i=0;i<imgArray.length;i++){
		   imgArray[i]._num = i;
		   imgArray[i].onclick=function(){
		    obj.rateFlag=true;
		    document.getElementById("hidrating_"+obj.id).value=this._num+1; //this._num+1这个数字写入到数据库中,作为评分的依据
		   };
		}
		if(target.tagName=="IMG"){
		document.getElementById("spNote_"+obj.id).innerHTML=target.title;
		   for(var j=0;j<imgArray.length;j++){
		   
		    if(j<=target._num){
		     imgArray[j].src=imgSrc_2;
		    } else {
		     imgArray[j].src=imgSrc;
		    }
		   }
		} else {
		   for(var k=0;k<imgArray.length;k++){
		    var num=document.getElementById("hidrating_"+obj.id).value;
		    if(num!="0"){
		       document.getElementById("spNote_"+obj.id).innerHTML=imgArray[num-1].title;
		    }else{
		     document.getElementById("spNote_"+obj.id).innerHTML="";
		    }
		    if(k<num){
		    imgArray[k].src=imgSrc_2;
		    }else{
		    imgArray[k].src=imgSrc;
		    }
		   }
		}
}

function saveDiscmt(id,type){
	$.post("saveDiscmt.htm", {
		'owner' :id,
		'ownerType':type,
		'overall':$("#hidrating_zp").val(),
		'popul':$("#hidrating_p").val(),
		'proportion':$("#hidrating_gm").val(),
		'serving':$("#hidrating_fw").val(),
		'recreation':$("#hidrating_yl").val(),
		'content':$("#disCmt_content").val()
	}, function(data) {
		if (data = 'success') {
			window.location.href="cmtSus.htm";
		}
	});
}
</script>

</head>
<body>
	<!-- head -->
	<%@include file="../common/header.jsp" %>
	<!-- header-->

	<div class="wrap">
    	<div class="i_container">
        	<h1><img src="../../images/smallpic/icon_13.gif" />对<b>“${owner.name}”</b>发表点评<i>(<em class="clrred">*</em>为必填项)</i> </h1>
            <ul class="dp_box">
            	<li class="clearfix">
                	<span class="dp_name"><i class="clrred f12">*</i>总体点评：</span>
                    <div class="right_box">
                    	<div class="star_box fl">
                                     <p id="zp" onmouseover="rate(this,event)"> 
							          <img src="images/smallpic/icon_15.gif" title="很烂" />
							          <img src="images/smallpic/icon_15.gif" title="一般" />
							          <img src="images/smallpic/icon_15.gif" title="还好" />
							          <img src="images/smallpic/icon_15.gif" title="较好" />
							          <img src="images/smallpic/icon_16.gif" title="很好" />
									  </p>
									  <input type="hidden" value="4" id="hidrating_zp" /><!--平分后 保存到数据库只需读取hidden的值即可-->
                                </div>
                                 <span class=" clrc06 ml5 fl" id="spNote_zp"></span>
                    </div>
                </li>
                <li class="clearfix">
                	<div class="dp_sorts_box">
                        <span class="dp_name"><i class="clrred f12">*</i>人气：</span>
                        <div class="right_box">
                            <div class="dp">
                                <div class="star_box fl">
                                     <p id="p" onmouseover="rate(this,event)"> 
							          <img src="images/smallpic/icon_15.gif" title="很烂" />
							          <img src="images/smallpic/icon_15.gif" title="一般" />
							          <img src="images/smallpic/icon_15.gif" title="还好" />
							          <img src="images/smallpic/icon_15.gif" title="较好" />
							          <img src="images/smallpic/icon_16.gif" title="很好" />
									  </p>
									  <input type="hidden" value="4" id="hidrating_p" /><!--平分后 保存到数据库只需读取hidden的值即可-->
                                </div>
                                 <span class=" clrc06 ml5 fl" id="spNote_p"></span>
                            </div>
                        </div>
                    </div>
                    <div class="dp_sorts_box">
                        <span class="dp_name"><i class="clrred f12">*</i>规模：</span>
                        <div class="right_box">
                             <div class="dp">
                                <div class="star_box fl">
                                     <p id="gm" onmouseover="rate(this,event)"> 
							          <img src="images/smallpic/icon_15.gif" title="很烂" />
							          <img src="images/smallpic/icon_15.gif" title="一般" />
							          <img src="images/smallpic/icon_15.gif" title="还好" />
							          <img src="images/smallpic/icon_15.gif" title="较好" />
							          <img src="images/smallpic/icon_16.gif" title="很好" />
									  </p>
									  <input type="hidden" value="4" id="hidrating_gm" /><!--平分后 保存到数据库只需读取hidden的值即可-->
                                </div>
                                 <span class=" clrc06 ml5 fl" id="spNote_gm"></span>
                            </div>
                        </div>
                    </div>
                    <div class="dp_sorts_box">
                        <span class="dp_name"><i class="clrred f12">*</i>娱乐：</span>
                        <div class="right_box">
                              <div class="dp">
                                <div class="star_box fl">
                                     <p id="yl" onmouseover="rate(this,event)"> 
							          <img src="images/smallpic/icon_15.gif" title="很烂" />
							          <img src="images/smallpic/icon_15.gif" title="一般" />
							          <img src="images/smallpic/icon_15.gif" title="还好" />
							          <img src="images/smallpic/icon_15.gif" title="较好" />
							          <img src="images/smallpic/icon_16.gif" title="很好" />
									  </p>
									  <input type="hidden" value="4" id="hidrating_yl" /><!--平分后 保存到数据库只需读取hidden的值即可-->
                                </div>
                                 <span class=" clrc06 ml5 fl" id="spNote_yl"></span>
                            </div>
                        </div>
                    </div>
                    <div class="dp_sorts_box">
                        <span class="dp_name"><i class="clrred f12">*</i>服务：</span>
                        <div class="right_box">
                           <div class="dp">
                                <div class="star_box fl">
                                     <p id="fw" onmouseover="rate(this,event)"> 
							          <img src="images/smallpic/icon_15.gif" title="很烂" />
							          <img src="images/smallpic/icon_15.gif" title="一般" />
							          <img src="images/smallpic/icon_15.gif" title="还好" />
							          <img src="images/smallpic/icon_15.gif" title="较好" />
							          <img src="images/smallpic/icon_16.gif" title="很好" />
									  </p>
									  <input type="hidden" value="4" id="hidrating_fw" /><!--平分后 保存到数据库只需读取hidden的值即可-->
                                </div>
                                 <span class=" clrc06 ml5 fl" id="spNote_fw"></span>
                            </div>
                        </div>
                    </div>
                </li>
                <li class="clearfix">
                	<span class="dp_name"><i class="clrred f12">*</i>点评内容：</span>
                    <div class="right_box">
                    	<p class="tip">[请不少于20字] </p>
                        <textarea id="disCmt_content"></textarea>
                        <!-- <p class="tip mt10">已输入了<i>0</i>个字</p> -->
                    </div>
                </li>
                <li class="clearfix">
                	<span class="dp_name"></span>
                    <div class="right_box">
                    	<input type="button" class="dp_btn1" value="发表" onclick="saveDiscmt('${owner.id}','${ot}');" />
                        <!-- <input type="button" class="dp_btn2" value="预览" /> -->
                    </div>
                </li>
            </ul>
        </div>	
    </div>        
    
    <div class="foot_seperate"></div>
    <!--footer-->
    <%@include file="../common/footer.jsp" %>
    <!--footer--end-->
</body>
</html>
